package com.west_traveler.recyclerview_adapter;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import com.viewpagerindicator.CirclePageIndicator;
import com.west_traveler.entity.entity_editor.Discovery;
import com.west_traveler.entity.entity_editor.EditorRecommend;
import com.west_traveler.entity.entity_editor.Imagess;
import com.west_traveler.entity.entity_editor.Info;
import com.west_traveler.entity.entity_editor.PerRecommend;
import com.west_traveler.entity.entity_editor.Special;
import com.west_traveler.entity.entity_editor.SpecialBean;
import com.west_traveler.entity.entity_project.Like;
import com.west_traveler.entity.entity_project.LikeProject;
import com.west_traveler.entity.entity_project.Novel;
import com.west_traveler.entity.entity_project.NovelProject;
import com.west_traveler.viewpager_adapter.FindPageHeadDiscoveryViewPagerAdapter;
import com.west_traveler.viewpager_adapter.FindPageHeadPicViewPagerAdapter;
import com.west_traveler.ximalayafm.MainActivity;
import com.west_traveler.ximalayafm.R;
import com.west_traveler.ximalayafm.SecondRecommendActivity;
import com.west_traveler.ximalayafm.SpecialActivity;

import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

import static com.west_traveler.ximalayafm.R.id.iv_find_fra_include_sound_info_icon;

/**
 * Description:
 * created at 2016/12/2 18:02
 *
 * @author: 黄昌友
 */

public class RecommentFraRecyclerViewAdapter extends RecyclerView.Adapter<RecommentFraRecyclerViewAdapter.ViewHolder> implements View.OnTouchListener {

    private Context context;
    private List total;
    private RecyclerView recyclerView;
    private CirclePageIndicator indicator;
    private CirclePageIndicator indicator_find;
    private List<Novel> datas;
    private ViewHolder vh;
    private List<NovelProject> listNovel;
    private List<LikeProject> likeGuessList;
    private List<PerRecommend> list;
    private int i;

    public RecommentFraRecyclerViewAdapter(Context context, List total) {
        this.context = context;
        this.total = total;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(viewType, parent, false);
        view.setTag(viewType);
        ViewHolder holder = new ViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(final ViewHolder holder, int position) {
        Object data = total.get(position);
        if (data instanceof Info) {
            final List<Imagess> imagessList = ((Info) data).getFocusImages().getList();
            FindPageHeadPicViewPagerAdapter pagerAdapter = new FindPageHeadPicViewPagerAdapter(((MainActivity) context).getSupportFragmentManager(), imagessList);
            holder.vp_fra_recommend_recyclerview_image.setAdapter(pagerAdapter);
            Timer timer = new Timer();
            timer.schedule(new TimerTask() {
                @Override
                public void run() {
                    i++;
                    holder.vp_fra_recommend_recyclerview_image.post(new Runnable() {
                        @Override
                        public void run() {
                            holder.vp_fra_recommend_recyclerview_image.setCurrentItem(i);
                            if (i == imagessList.size()) {
                                i = 0;
                                holder.vp_fra_recommend_recyclerview_image.setCurrentItem(i, false);
                            }
                        }
                    });
                }
            }, 0, 3000);

            indicator.setViewPager(holder.vp_fra_recommend_recyclerview_image);

            Discovery discovery = ((Info) data).getDiscoveryColumns();
            FindPageHeadDiscoveryViewPagerAdapter adapter = new FindPageHeadDiscoveryViewPagerAdapter(((MainActivity) context).getSupportFragmentManager(), discovery);
            holder.vp_fra_recommend_recyclerview_find.setAdapter(adapter);
            indicator_find.setViewPager(holder.vp_fra_recommend_recyclerview_find);
        } else if (data instanceof Like) {
            holder.tv_find_Fra_Sound_Category.setText(((Like) data).getTitle());
            likeGuessList = ((Like) data).getList();
            holder.tv_guesslike_trackTitle_c1.setText(likeGuessList.get(0).getTitle());
            holder.tv_guesslike_trackTitle_c2.setText(likeGuessList.get(1).getTitle());
            holder.tv_guesslike_trackTitle_c3.setText(likeGuessList.get(2).getTitle());
            holder.tv_guesslike_trackTitle_c4.setText(likeGuessList.get(3).getTitle());
            holder.tv_guesslike_trackTitle_c5.setText(likeGuessList.get(4).getTitle());
            holder.tv_guesslike_trackTitle_c6.setText(likeGuessList.get(5).getTitle());

            if (likeGuessList.get(0).getTags() == null) {
                holder.iv_guesslike_icon_c1.setVisibility(View.GONE);
            } else {
                holder.iv_guesslike_icon_c1.setVisibility(View.VISIBLE);
                holder.tv_guesslike_subTitle_c1.setText(likeGuessList.get(0).getTags());
            }
            if (likeGuessList.get(1).getTags() == null) {
                holder.iv_guesslike_icon_c2.setVisibility(View.GONE);
            } else {
                holder.iv_guesslike_icon_c2.setVisibility(View.VISIBLE);
                holder.tv_guesslike_subTitle_c2.setText(likeGuessList.get(1).getTags());
            }

            if (likeGuessList.get(2).getTags() == null) {
                holder.iv_guesslike_icon_c3.setVisibility(View.GONE);
            } else {
                holder.iv_guesslike_icon_c3.setVisibility(View.VISIBLE);
                holder.tv_guesslike_subTitle_c3.setText(likeGuessList.get(2).getTags());
            }

            if (likeGuessList.get(3).getTags() == null) {
                holder.iv_guesslike_icon_c4.setVisibility(View.GONE);
            } else {
                holder.iv_guesslike_icon_c4.setVisibility(View.VISIBLE);
                holder.tv_guesslike_subTitle_c4.setText(likeGuessList.get(3).getTags());
            }
            if (likeGuessList.get(4).getTags() == null) {
                holder.iv_guesslike_icon_c5.setVisibility(View.GONE);
            } else {
                holder.iv_guesslike_icon_c5.setVisibility(View.VISIBLE);
                holder.tv_guesslike_subTitle_c5.setText(likeGuessList.get(4).getTags());
            }

            if (likeGuessList.get(5).getTags() == null) {
                holder.iv_guesslike_icon_c6.setVisibility(View.GONE);
            } else {
                holder.iv_guesslike_icon_c6.setVisibility(View.VISIBLE);
                holder.tv_guesslike_subTitle_c6.setText(likeGuessList.get(5).getTags());
            }
            Picasso.with(context).load(likeGuessList.get(0).getCoverSmall()).into(holder.iv_find_fra_include_sound_info_img_c1);
            Picasso.with(context).load(likeGuessList.get(1).getCoverSmall()).into(holder.iv_find_fra_include_sound_info_img_c2);
            Picasso.with(context).load(likeGuessList.get(2).getCoverSmall()).into(holder.iv_find_fra_include_sound_info_img_c3);
            Picasso.with(context).load(likeGuessList.get(3).getCoverSmall()).into(holder.iv_find_fra_include_sound_info_img_c4);
            Picasso.with(context).load(likeGuessList.get(4).getCoverSmall()).into(holder.iv_find_fra_include_sound_info_img_c5);
            Picasso.with(context).load(likeGuessList.get(5).getCoverSmall()).into(holder.iv_find_fra_include_sound_info_img_c6);

            holder.iv_find_fra_include_sound_info_img_c1.setOnTouchListener(this);
            holder.iv_find_fra_include_sound_info_img_c2.setOnTouchListener(this);
            holder.iv_find_fra_include_sound_info_img_c3.setOnTouchListener(this);
            holder.iv_find_fra_include_sound_info_img_c4.setOnTouchListener(this);
            holder.iv_find_fra_include_sound_info_img_c5.setOnTouchListener(this);
            holder.iv_find_fra_include_sound_info_img_c6.setOnTouchListener(this);
            photoListener(holder.iv_find_fra_include_sound_info_img_c1, 0, position);
            photoListener(holder.iv_find_fra_include_sound_info_img_c2, 1, position);
            photoListener(holder.iv_find_fra_include_sound_info_img_c3, 2, position);
            photoListener(holder.iv_find_fra_include_sound_info_img_c4, 3, position);
            photoListener(holder.iv_find_fra_include_sound_info_img_c5, 4, position);
            photoListener(holder.iv_find_fra_include_sound_info_img_c6, 5, position);
        } else if (data instanceof EditorRecommend) {

            EditorRecommend editorRecommend = (EditorRecommend) data;
            list = editorRecommend.getList();
            holder.tv_find_Fra_Sound_Category.setText(editorRecommend.getTitle());
            if (list.get(0).getIsFinished() == 0) {
                holder.iv_find_fra_include_sound_info_finish_c1.setVisibility(View.GONE);
            }
            holder.tv_find_fra_sound_info_trackTitle_c1.setText(list.get(0).getTrackTitle());
            holder.tv_find_fra_sound_info_title_c1.setText(list.get(0).getTitle());
            Picasso.with(context).load(list.get(0).getCoverMiddle()).into(holder.iv_find_fra_sound_info_icon_c1);

            if (list.get(1).getIsFinished() == 0) {
                holder.iv_find_fra_include_sound_info_finish_c2.setVisibility(View.GONE);
            }
            holder.tv_find_fra_sound_info_trackTitle_c2.setText(list.get(1).getTrackTitle());
            holder.tv_find_fra_sound_info_title_c2.setText(list.get(1).getTitle());
            Picasso.with(context).load(list.get(1).getCoverMiddle()).into(holder.iv_find_fra_sound_info_icon_c2);

            if (list.get(2).getIsFinished() == 0) {
                holder.iv_find_fra_include_sound_info_finish_c3.setVisibility(View.GONE);
            }
            holder.tv_find_fra_sound_info_trackTitle_c3.setText(list.get(2).getTrackTitle());
            holder.tv_find_fra_sound_info_title_c3.setText(list.get(2).getTitle());
            Picasso.with(context).load(list.get(2).getCoverMiddle()).into(holder.iv_find_fra_sound_info_icon_c3);

            holder.iv_find_fra_sound_info_icon_c1.setOnTouchListener(this);
            holder.iv_find_fra_sound_info_icon_c2.setOnTouchListener(this);
            holder.iv_find_fra_sound_info_icon_c3.setOnTouchListener(this);

            photoListener(holder.iv_find_fra_sound_info_icon_c1, 0, position);
            photoListener(holder.iv_find_fra_sound_info_icon_c2, 1, position);
            photoListener(holder.iv_find_fra_sound_info_icon_c3, 2, position);

        } else if (data instanceof Special) {
            Special special = (Special) data;
            holder.tv_find_Fra_Sound_Category.setText(special.getTitle());
            final List<SpecialBean> specialList = special.getList();
            Picasso.with(context).load(specialList.get(0).getCoverPath()).into(holder.iv_find_fra_specialsound);
            holder.tv_find_fra_sound_info_soundtrackTitle.setText(specialList.get(0).getTitle());
            holder.tv_find_fra_sound_info_soundsubtitle.setText(specialList.get(0).getSubtitle());
            holder.tv_find_fra_sound_info_soundfoottitle.setText(specialList.get(0).getFootnote());
            holder.specialSound_viewgroup.setOnTouchListener(this);
            holder.specialSound_viewgroup.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent intent = new Intent();
                    intent.setClass(context, SpecialActivity.class);
                    intent.putExtra("ID", specialList.get(0).getSpecialId());
                    context.startActivity(intent);
                }
            });
        } else if (data instanceof List) {
            vh = holder;
            datas = (List) data;
            listNovel = datas.get(position - 4).getList();
            holder.tv_find_Fra_Sound_Category.setText(datas.get(position - 4).getTitle());
            if (datas.get(position - 4).getList().get(0).getIsFinished() == 0) {
                holder.iv_find_fra_include_sound_info_finish_c1.setVisibility(View.GONE);
            }
            holder.tv_find_fra_sound_info_trackTitle_c1.setText(datas.get(position - 4).getList().get(0).getTrackTitle());
            holder.tv_find_fra_sound_info_title_c1.setText(datas.get(position - 4).getList().get(0).getTitle());
            Picasso.with(context).load(datas.get(position - 4).getList().get(0).getCoverMiddle()).into(holder.iv_find_fra_sound_info_icon_c1);

            if (datas.get(position - 4).getList().get(1).getIsFinished() == 0) {
                holder.iv_find_fra_include_sound_info_finish_c2.setVisibility(View.GONE);
            }
            holder.tv_find_fra_sound_info_trackTitle_c2.setText(datas.get(position - 4).getList().get(1).getTrackTitle());
            holder.tv_find_fra_sound_info_title_c2.setText(datas.get(position - 4).getTitle());
            Picasso.with(context).load(datas.get(position - 4).getList().get(1).getCoverMiddle()).into(holder.iv_find_fra_sound_info_icon_c2);

            if (datas.get(position - 4).getList().get(2).getIsFinished() == 0) {
                holder.iv_find_fra_include_sound_info_finish_c3.setVisibility(View.GONE);
            }
            holder.tv_find_fra_sound_info_trackTitle_c3.setText(datas.get(position - 4).getList().get(2).getTrackTitle());
            holder.tv_find_fra_sound_info_title_c3.setText(datas.get(position - 4).getTitle());
            Picasso.with(context).load(datas.get(position - 4).getList().get(2).getCoverMiddle()).into(holder.iv_find_fra_sound_info_icon_c3);

            holder.iv_find_fra_sound_info_icon_c1.setOnTouchListener(this);
            holder.iv_find_fra_sound_info_icon_c2.setOnTouchListener(this);
            holder.iv_find_fra_sound_info_icon_c3.setOnTouchListener(this);

            photoListener(holder.iv_find_fra_sound_info_icon_c1, 0, position - 4);
            photoListener(holder.iv_find_fra_sound_info_icon_c2, 1, position - 4);
            photoListener(holder.iv_find_fra_sound_info_icon_c3, 2, position - 4);
        }
    }

    @Override
    public int getItemCount() {
        return total.size();
    }

    @Override
    public void onAttachedToRecyclerView(RecyclerView recyclerView) {
        super.onAttachedToRecyclerView(recyclerView);
        this.recyclerView = recyclerView;
    }

    @Override
    public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
        super.onDetachedFromRecyclerView(recyclerView);
        this.recyclerView = null;
    }

    @Override
    public int getItemViewType(int position) {
        Object data = total.get(position);
        if (data instanceof Info) {
            return R.layout.fra_recommend_recycleview_item_image_and_find;
        } else if (data instanceof Like) {
            return R.layout.fra_recommend_recycleview_item_guesslikes;
        } else if (data instanceof EditorRecommend) {
            return R.layout.fra_recommend_recycleview_item_editorrecommend;
        } else if (data instanceof Special) {
            return R.layout.fra_recommend_recycleview_item_specialsounditem;
        } else {
            return R.layout.fra_recommend_recycleview_item;
        }
    }

    @Override
    public boolean onTouch(View view, MotionEvent motionEvent) {

        switch (motionEvent.getAction()) {
            case MotionEvent.ACTION_DOWN:
                view.setAlpha((float) 0.5);
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_MOVE:
                view.setAlpha(1);
                break;
        }
        return false;
    }

    public void photoListener(ImageView view, final int i, final int position) {
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.setClass(context, SecondRecommendActivity.class);
                switch (view.getId()) {
                    case R.id.iv_find_fra_include_sound_info_icon:
                        if (position == 2) {
                            intent.putExtra("ID", list.get(i).getAlbumId() + "");
                            intent.putExtra("Title", list.get(i).getTitle());
                            intent.putExtra("PlaysCounts", list.get(i).getPlaysCounts() + "");
                            intent.putExtra("Nickname", list.get(i).getNickname());
                            intent.putExtra("CoverMiddle", list.get(i).getCoverMiddle());
                        } else {
                            intent.putExtra("ID", datas.get(position).getList().get(i).getAlbumId() + "");
                            intent.putExtra("Title", datas.get(position).getList().get(i).getTitle());
                            intent.putExtra("PlaysCounts", datas.get(position).getList().get(i).getPlaysCounts() + "");
                            intent.putExtra("Nickname", datas.get(position).getList().get(i).getNickname());
                            intent.putExtra("CoverMiddle", datas.get(position).getList().get(i).getCoverMiddle());
                        }

                        break;
                    case R.id.iv_find_fra_include_sound_info_guesslike_icon:
                        //Toast.makeText(context, "发送方的id" + likeGuessList.get(i).getAlbumId() + "", Toast.LENGTH_SHORT).show();
                        intent.putExtra("ID", likeGuessList.get(i).getAlbumId() + "");
                        intent.putExtra("Title", likeGuessList.get(i).getTitle());
                        intent.putExtra("PlaysCounts", likeGuessList.get(i).getPlaysCounts() + "");
                        intent.putExtra("Nickname", likeGuessList.get(i).getNickname());
                        intent.putExtra("CoverMiddle", likeGuessList.get(i).getCoverMiddle());
                        break;
                }
                context.startActivity(intent);
            }
        });
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        private TextView tv_find_Fra_Sound_Category;

        private TextView tv_find_fra_sound_info_title_c1;
        private TextView tv_find_fra_sound_info_trackTitle_c1;
        private ImageView iv_find_fra_sound_info_icon_c1;
        private ImageView iv_find_fra_include_sound_info_finish_c1;

        private TextView tv_find_fra_sound_info_title_c2;
        private TextView tv_find_fra_sound_info_trackTitle_c2;
        private ImageView iv_find_fra_include_sound_info_finish_c2;

        private ImageView iv_find_fra_sound_info_icon_c2;
        private TextView tv_find_fra_sound_info_title_c3;
        private TextView tv_find_fra_sound_info_trackTitle_c3;
        private ImageView iv_find_fra_sound_info_icon_c3;
        private ImageView iv_find_fra_include_sound_info_finish_c3;

        //推荐顶部viewpager
        private ViewPager vp_fra_recommend_recyclerview_image;
        private ViewPager vp_fra_recommend_recyclerview_find;

        //猜你喜欢
        private ImageView iv_guesslike_icon_c1;
        private ImageView iv_guesslike_icon_c2;
        private ImageView iv_guesslike_icon_c3;
        private ImageView iv_guesslike_icon_c4;
        private ImageView iv_guesslike_icon_c5;
        private ImageView iv_guesslike_icon_c6;

        private TextView tv_guesslike_trackTitle_c1;
        private TextView tv_guesslike_trackTitle_c2;
        private TextView tv_guesslike_trackTitle_c3;
        private TextView tv_guesslike_trackTitle_c4;
        private TextView tv_guesslike_trackTitle_c5;
        private TextView tv_guesslike_trackTitle_c6;

        private TextView tv_guesslike_subTitle_c1;
        private TextView tv_guesslike_subTitle_c2;
        private TextView tv_guesslike_subTitle_c3;
        private TextView tv_guesslike_subTitle_c4;
        private TextView tv_guesslike_subTitle_c5;
        private TextView tv_guesslike_subTitle_c6;

        private ImageView iv_find_fra_include_sound_info_img_c1;
        private ImageView iv_find_fra_include_sound_info_img_c2;
        private ImageView iv_find_fra_include_sound_info_img_c3;
        private ImageView iv_find_fra_include_sound_info_img_c4;
        private ImageView iv_find_fra_include_sound_info_img_c5;
        private ImageView iv_find_fra_include_sound_info_img_c6;

        //精品听单
        private ImageView iv_find_fra_specialsound;
        private TextView tv_find_fra_sound_info_soundtrackTitle;
        private TextView tv_find_fra_sound_info_soundsubtitle;
        private TextView tv_find_fra_sound_info_soundfoottitle;
        private RelativeLayout specialSound_viewgroup;

        public ViewHolder(View itemView) {
            super(itemView);
            int tag = (int) itemView.getTag();
            if (tag == R.layout.fra_recommend_recycleview_item_image_and_find) {
                //推荐界面 顶部viewpager
                tv_find_Fra_Sound_Category = ((TextView) itemView.findViewById(R.id.tv_find_fra_sound_category_id));
                indicator = (CirclePageIndicator) itemView.findViewById(R.id.indicator);
                indicator.setPageColor(Color.GRAY);
                indicator.setStrokeColor(Color.GRAY);
                indicator.setRadius(20);
                vp_fra_recommend_recyclerview_image = ((ViewPager) itemView.findViewById(R.id.vp_fra_recommend_recyclerview_image));
                vp_fra_recommend_recyclerview_find = ((ViewPager) itemView.findViewById(R.id.vp_fra_recommend_recyclerview_find));
                indicator_find = ((CirclePageIndicator) itemView.findViewById(R.id.indicator_find));
                indicator_find.setPageColor(Color.GRAY);
                indicator_find.setFillColor(Color.BLACK);
                indicator.setRadius(15);
            }
            if (tag == R.layout.fra_recommend_recycleview_item_guesslikes) {
                //猜你喜欢 控件
                tv_find_Fra_Sound_Category = ((TextView) itemView.findViewById(R.id.tv_find_fra_sound_category_id));
                iv_guesslike_icon_c1 = ((ImageView) itemView.findViewById(R.id.c1).findViewById(R.id.iv_find_fra_include_sound_info_img));
                iv_guesslike_icon_c2 = ((ImageView) itemView.findViewById(R.id.c2).findViewById(R.id.iv_find_fra_include_sound_info_img));
                iv_guesslike_icon_c3 = ((ImageView) itemView.findViewById(R.id.c3).findViewById(R.id.iv_find_fra_include_sound_info_img));
                iv_guesslike_icon_c4 = ((ImageView) itemView.findViewById(R.id.c4).findViewById(R.id.iv_find_fra_include_sound_info_img));
                iv_guesslike_icon_c5 = ((ImageView) itemView.findViewById(R.id.c5).findViewById(R.id.iv_find_fra_include_sound_info_img));
                iv_guesslike_icon_c6 = ((ImageView) itemView.findViewById(R.id.c6).findViewById(R.id.iv_find_fra_include_sound_info_img));

                tv_guesslike_trackTitle_c1 = ((TextView) itemView.findViewById(R.id.c1).findViewById(R.id.tv_find_fra_sound_info_guesslike_trackTitle));
                tv_guesslike_trackTitle_c2 = ((TextView) itemView.findViewById(R.id.c2).findViewById(R.id.tv_find_fra_sound_info_guesslike_trackTitle));
                tv_guesslike_trackTitle_c3 = ((TextView) itemView.findViewById(R.id.c3).findViewById(R.id.tv_find_fra_sound_info_guesslike_trackTitle));
                tv_guesslike_trackTitle_c4 = ((TextView) itemView.findViewById(R.id.c4).findViewById(R.id.tv_find_fra_sound_info_guesslike_trackTitle));
                tv_guesslike_trackTitle_c5 = ((TextView) itemView.findViewById(R.id.c5).findViewById(R.id.tv_find_fra_sound_info_guesslike_trackTitle));
                tv_guesslike_trackTitle_c6 = ((TextView) itemView.findViewById(R.id.c6).findViewById(R.id.tv_find_fra_sound_info_guesslike_trackTitle));

                tv_guesslike_subTitle_c1 = ((TextView) itemView.findViewById(R.id.c1).findViewById(R.id.tv_find_fra_sound_info_guesslike_subtitle));
                tv_guesslike_subTitle_c2 = ((TextView) itemView.findViewById(R.id.c2).findViewById(R.id.tv_find_fra_sound_info_guesslike_subtitle));
                tv_guesslike_subTitle_c3 = ((TextView) itemView.findViewById(R.id.c1).findViewById(R.id.tv_find_fra_sound_info_guesslike_subtitle));
                tv_guesslike_subTitle_c4 = ((TextView) itemView.findViewById(R.id.c4).findViewById(R.id.tv_find_fra_sound_info_guesslike_subtitle));
                tv_guesslike_subTitle_c5 = ((TextView) itemView.findViewById(R.id.c5).findViewById(R.id.tv_find_fra_sound_info_guesslike_subtitle));
                tv_guesslike_subTitle_c6 = ((TextView) itemView.findViewById(R.id.c6).findViewById(R.id.tv_find_fra_sound_info_guesslike_subtitle));

                iv_find_fra_include_sound_info_img_c1 = ((ImageView) itemView.findViewById(R.id.c1).findViewById(R.id.iv_find_fra_include_sound_info_guesslike_icon));
                iv_find_fra_include_sound_info_img_c2 = ((ImageView) itemView.findViewById(R.id.c2).findViewById(R.id.iv_find_fra_include_sound_info_guesslike_icon));
                iv_find_fra_include_sound_info_img_c3 = ((ImageView) itemView.findViewById(R.id.c3).findViewById(R.id.iv_find_fra_include_sound_info_guesslike_icon));
                iv_find_fra_include_sound_info_img_c4 = ((ImageView) itemView.findViewById(R.id.c4).findViewById(R.id.iv_find_fra_include_sound_info_guesslike_icon));
                iv_find_fra_include_sound_info_img_c5 = ((ImageView) itemView.findViewById(R.id.c5).findViewById(R.id.iv_find_fra_include_sound_info_guesslike_icon));
                iv_find_fra_include_sound_info_img_c6 = ((ImageView) itemView.findViewById(R.id.c6).findViewById(R.id.iv_find_fra_include_sound_info_guesslike_icon));

            }

            if (tag == R.layout.fra_recommend_recycleview_item_editorrecommend || tag == R.layout.fra_recommend_recycleview_item) {
                //小编推荐和 下面听的20种类型一样的布局
                tv_find_Fra_Sound_Category = ((TextView) itemView.findViewById(R.id.tv_find_fra_sound_category_id));

                tv_find_fra_sound_info_title_c1 = (TextView) itemView.findViewById(R.id.c1).findViewById(R.id.tv_find_fra_sound_info_title);
                tv_find_fra_sound_info_trackTitle_c1 = (TextView) itemView.findViewById(R.id.c1).findViewById(R.id.tv_find_fra_sound_info_trackTitle);
                iv_find_fra_sound_info_icon_c1 = ((ImageView) itemView.findViewById(R.id.c1).findViewById(iv_find_fra_include_sound_info_icon));
                iv_find_fra_include_sound_info_finish_c1 = ((ImageView) itemView.findViewById(R.id.c1).findViewById(R.id.iv_find_fra_include_sound_info_isfinish_icon));
//
                tv_find_fra_sound_info_title_c2 = (TextView) itemView.findViewById(R.id.c2).findViewById(R.id.tv_find_fra_sound_info_title);
                tv_find_fra_sound_info_trackTitle_c2 = (TextView) itemView.findViewById(R.id.c2).findViewById(R.id.tv_find_fra_sound_info_trackTitle);
                iv_find_fra_sound_info_icon_c2 = ((ImageView) itemView.findViewById(R.id.c2).findViewById(iv_find_fra_include_sound_info_icon));
                iv_find_fra_include_sound_info_finish_c2 = ((ImageView) itemView.findViewById(R.id.c2).findViewById(R.id.iv_find_fra_include_sound_info_isfinish_icon));

                tv_find_fra_sound_info_title_c3 = (TextView) itemView.findViewById(R.id.c3).findViewById(R.id.tv_find_fra_sound_info_title);
                tv_find_fra_sound_info_trackTitle_c3 = (TextView) itemView.findViewById(R.id.c3).findViewById(R.id.tv_find_fra_sound_info_trackTitle);
                iv_find_fra_sound_info_icon_c3 = ((ImageView) itemView.findViewById(R.id.c3).findViewById(iv_find_fra_include_sound_info_icon));
                iv_find_fra_include_sound_info_finish_c3 = ((ImageView) itemView.findViewById(R.id.c3).findViewById(R.id.iv_find_fra_include_sound_info_isfinish_icon));

            }

            if (tag == R.layout.fra_recommend_recycleview_item_specialsounditem) {
                //精品听单
                iv_find_fra_specialsound = ((ImageView) itemView.findViewById(R.id.iv_find_fra_include_sound_info_soundicon));
                tv_find_fra_sound_info_soundtrackTitle = ((TextView) itemView.findViewById(R.id.tv_find_fra_sound_info_soundtrackTitle));
                tv_find_fra_sound_info_soundsubtitle = ((TextView) itemView.findViewById(R.id.tv_find_fra_sound_info_soundsubtitle));
                tv_find_fra_sound_info_soundfoottitle = ((TextView) itemView.findViewById(R.id.tv_find_fra_sound_info_soundfoottitle));
                tv_find_Fra_Sound_Category = ((TextView) itemView.findViewById(R.id.tv_find_fra_sound_category_id));

                specialSound_viewgroup = (RelativeLayout) itemView.findViewById(R.id.rl_find_fra_include_sound_info_viewgroup);
            }
        }
    }
}

